import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { MypicComponent } from "./pages/mypic/mypic.component";
import { TestComponent } from "./pages/test/test.component";
import { MychatComponent } from "./mychat/mychat.component";
import { BrowserModule } from "@angular/platform-browser";
import { FormsModule } from "@angular/forms";

const routes: Routes = [
  { path: "", pathMatch: "full", redirectTo: "/welcome" },
  {
    path: "welcome",
    //loadChildren 加载模块的路由
    loadChildren: () =>
      import("./pages/welcome/welcome.module").then((m) => m.WelcomeModule),
  },
  { path: "mypic", component: MypicComponent },
  { path: "test", component: TestComponent },
  { path:"mychat",component: MychatComponent},

    {
    path: "welcome/ticTacToe",
    //loadChildren 加载模块的路由
    loadChildren: () =>
    import("./pages/welcome/welcome.module").then((m) => m.WelcomeModule),
  },

];

@NgModule({
  imports: [RouterModule.forRoot(routes), BrowserModule, FormsModule],
  exports: [RouterModule],
  declarations: [],
})
export class AppRoutingModule {}
